<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ol id="elem">
        <li>Hello</li>
        <li>World</li>
    </ol>
    <script>
        let elem = document.getElementById('elem');
        // console.log(elem.children[0]);
        // console.log(elem.children[0].innerHTML = '');

        // console.log(elem.children.length);

        function clear(elem) {
            for (var i = 0; i < elem.children.length; i++) {
                console.log(elem.children[i].innerHTML = '');
            }
        }

        clear(elem);
    </script>
</body>

</html>